﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000146 RID: 326
	[Serializable]
	public class RecordedFrame
	{
		// Token: 0x060006E9 RID: 1769 RVA: 0x00029038 File Offset: 0x00027238
		public RecordedFrame()
		{
		}

		// Token: 0x060006EA RID: 1770 RVA: 0x00029048 File Offset: 0x00027248
		public RecordedFrame(PlaygroundParticlesC playgroundParticles, float keyframeInterval)
		{
			this.particles = new PlaybackParticle[playgroundParticles.particleCache.Length];
			for (int i = 0; i < this.particles.Length; i++)
			{
				this.particles[i] = new PlaybackParticle(playgroundParticles.playgroundCache.position[i], playgroundParticles.playgroundCache.velocity[i], playgroundParticles.playgroundCache.rotation[i], playgroundParticles.playgroundCache.size[i], playgroundParticles.particleCache[i].lifetime, playgroundParticles.particleCache[i].startLifetime, playgroundParticles.playgroundCache.life[i], playgroundParticles.playgroundCache.birth[i], playgroundParticles.playgroundCache.death[i], playgroundParticles.playgroundCache.lifetimeSubtraction[i], playgroundParticles.playgroundCache.color[i], playgroundParticles.playgroundCache.targetPosition[i], playgroundParticles.playgroundCache.initialSize[i]);
			}
			this.timeStamp = Time.realtimeSinceStartup;
			this.keyframeInterval = keyframeInterval;
		}

		// Token: 0x060006EB RID: 1771 RVA: 0x0002918C File Offset: 0x0002738C
		public virtual RecordedFrame Clone()
		{
			return new RecordedFrame
			{
				particles = (PlaybackParticle[])this.particles.Clone(),
				timeStamp = this.timeStamp,
				frameType = this.frameType
			};
		}

		// Token: 0x060006EC RID: 1772 RVA: 0x000291D0 File Offset: 0x000273D0
		public virtual ParticleSystem.Particle[] CloneAsParticles()
		{
			ParticleSystem.Particle[] array = new ParticleSystem.Particle[this.particles.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = this.particles[i].CloneAsParticle(false);
			}
			return array;
		}

		// Token: 0x060006ED RID: 1773 RVA: 0x00029220 File Offset: 0x00027420
		public virtual SerializedFrame CloneAsSerializedFrame()
		{
			return new SerializedFrame
			{
				serializedParticles = this.CloneAsSerializedParticles(),
				keyframeInterval = this.keyframeInterval,
				timeStamp = this.timeStamp,
				frameType = this.frameType
			};
		}

		// Token: 0x060006EE RID: 1774 RVA: 0x00029264 File Offset: 0x00027464
		public virtual SerializedParticle[] CloneAsSerializedParticles()
		{
			SerializedParticle[] array = new SerializedParticle[this.particles.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = this.particles[i].CloneAsSerializedParticle();
			}
			return array;
		}

		// Token: 0x040006FB RID: 1787
		[HideInInspector]
		public PlaybackParticle[] particles;

		// Token: 0x040006FC RID: 1788
		[HideInInspector]
		public float timeStamp;

		// Token: 0x040006FD RID: 1789
		[HideInInspector]
		public float keyframeInterval;

		// Token: 0x040006FE RID: 1790
		[HideInInspector]
		public FrameType frameType = FrameType.Middle;
	}
}
